From 96c071bf9c1249cce58c3fc39363bac6808b58b5 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 4 Feb 2009 15:29:51 +0000 Subject: [PATCH] Remove cpumask for page_info struct. This makes TLB flushing on page allocation more conservative, but the flush clock should still save us most of the time (page freeing and alloc'ing tends to happen in batches, and not necesasrily close together). We could add some optimisations to the flush filter if this does turn out to be a significant overhead for some (useful) workloads. Signed-off-by: Keir Fraser --- xen/common/page_alloc.c | 15 ++++----------- xen/include/asm-ia64/mm.h | 9 --------- xen/include/asm-x86/mm.h | 6 ------ 3 files changed, 4 insertions(+), 26 deletions(-) diff --git a/xen/common/page_alloc.c b/xen/common/page_alloc.c index ff3556ed7f..de99f7333b 100644 --- a/xen/common/page_alloc.c +++ b/xen/common/page_alloc.c @@ -400,7 +400,7 @@ static struct page_info *alloc_heap_pages( BUG_ON(pg[i].count_info != 0); /* Add in any extra CPUs that need flushing because of this page. */ - cpus_andnot(extra_cpus_mask, pg[i].u.free.cpumask, mask); + cpus_andnot(extra_cpus_mask, cpu_online_map, mask); tlbflush_filter(extra_cpus_mask, pg[i].tlbflush_timestamp); cpus_or(mask, mask, extra_cpus_mask); @@ -425,7 +425,6 @@ static void free_heap_pages( unsigned long mask; unsigned int i, node = phys_to_nid(page_to_maddr(pg)); unsigned int zone = page_to_zone(pg); - struct domain *d; ASSERT(order <= MAX_ORDER); ASSERT(node >= 0); @@ -446,15 +445,9 @@ static void free_heap_pages( */ pg[i].count_info = 0; - if ( (d = page_get_owner(&pg[i])) != NULL ) - { - pg[i].tlbflush_timestamp = tlbflush_current_time(); - pg[i].u.free.cpumask = d->domain_dirty_cpumask; - } - else - { - cpus_clear(pg[i].u.free.cpumask); - } + /* If a page has no owner it will need no safety TLB flush. */ + pg[i].tlbflush_timestamp = + page_get_owner(&pg[i]) ? tlbflush_current_time() : 0; } spin_lock(&heap_lock); diff --git a/xen/include/asm-ia64/mm.h b/xen/include/asm-ia64/mm.h index 7337a707cc..d28aa565dc 100644 --- a/xen/include/asm-ia64/mm.h +++ b/xen/include/asm-ia64/mm.h @@ -62,21 +62,12 @@ struct page_info struct { /* Order-size of the free chunk this page is the head of. */ u32 order; - /* Mask of possibly-tainted TLBs. */ - cpumask_t cpumask; } free; } u; /* Timestamp from 'TLB clock', used to reduce need for safety flushes. */ u32 tlbflush_timestamp; - -#if 0 -// following added for Linux compiling - page_flags_t flags; - atomic_t _count; - struct list_head lru; // is this the same as above "list"? -#endif }; #define set_page_count(p,v) atomic_set(&(p)->_count, v - 1) diff --git a/xen/include/asm-x86/mm.h b/xen/include/asm-x86/mm.h index 740cc6b58f..4a8c37f96a 100644 --- a/xen/include/asm-x86/mm.h +++ b/xen/include/asm-x86/mm.h @@ -66,12 +66,6 @@ struct page_info unsigned long count:26; /* Reference count */ } sh; - /* Page is on a free list: ((count_info & PGC_count_mask) == 0). */ - struct { - /* Mask of possibly-tainted TLBs. */ - cpumask_t cpumask; - } free; - } u; union { -- 2.30.2